package com.onlineMIS.ORM.entity.headQ.inventory;

import com.onlineMIS.common.loggerLocal;

public class HeadqCalculateInventoryVO {
	private String barcode;
	private int orderType;
	private int quantity;
	
	public HeadqCalculateInventoryVO(String barcode) {
		this.barcode = barcode;
	}
	
	public void addQ(int orderType, int quantity) {
		switch (orderType) {
		case InventoryOrder.TYPE_SALES_ORDER_W:
		case InventoryOrder.TYPE_SALES_FREE_ORDER_W:
			this.quantity -= quantity;
			break;
		case InventoryOrder.TYPE_SALES_RETURN_ORDER_W:
			this.quantity += quantity;
			break;
		default:
			loggerLocal.error("错误的单据种类 : " + orderType);
			break;
		}
	}
	
	

	public String getBarcode() {
		return barcode;
	}

	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}

	public int getOrderType() {
		return orderType;
	}
	public void setOrderType(int orderType) {
		this.orderType = orderType;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	
}
